#pragma once
class _ZTP_EXT_CLASS ZNCHttpPub
{
public:
	ZNCHttpPub();
	~ZNCHttpPub();

	static BOOL getBoisIDByCmd(char *lpszBaseBoard,int sleepnum );
	static CString	GetBoisID();

	static void		SetUrl(CString strurl);
	static CString	GetUrl();
	static CString	Gettoken();
	static void		Settoken(CString &mmtoken);


	//////////////////////////////////////////////////////////////////////////
	//tool
	static wchar_t* QXUtf82Unicode(const char* utf, size_t *unicode_number);
	static void		QXCstring2Utf8(CString & tvar,ZNCharA & mZNCharA);
	static char*	QXUnicode2Utf8(const wchar_t* unicode);
	//static CString	URLUTF8(CString URL);
	static CString	Getrandstr(){return ZTStr::CreateGuid();}
	//const char* ft_http_sync_post_file(ft_http_client_t* http, const char* url, const char* filepath);
	CMapStringToString PRAMSTR;
	CString m_Authorization;	
	int m_retcode;
	virtual CString GetPramstr();
	virtual void	ClearParam()	{		PRAMSTR.RemoveAll();	}
	virtual void	AddPram(CString key,CString var)
	{
		PRAMSTR.SetAt(key, var);
	}
	static CString	UTF82STR( const char * ret);

	static CString	Put_off_limit(int off,int limit);
	//static CString	GetJsonOneData(CString & str,CString   key);
	//static int		GetJsonOneDataint(CString & str,CString   key);
	static void		UTF8STR2STR( CString & ret);
	//static CString	GetFileUTF8(CStdioFile* pHTTPFile);
	virtual void	CheckJsonStr(CString & jssrt); 
	static CString  HTTPFILE2STR(CStdioFile* pHTTPFile);
	static CString GetFileUTF8(CStdioFile* pHTTPFile)
	{
		return HTTPFILE2STR(pHTTPFile);
	}

	static void Files2body(std::vector<CString> & files,CMemFile & MFFF,CString name = _T("file"));
	static CString TGetUploadFileHeader(CString filename,CString othname = _T("file"));
	static CString GetBoundStr();

};
